﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Links.aspx.cs" Inherits="Main_Personal_Links" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
   <%-- <link rel="Stylesheet" href="../css/main.css" />--%>
</head>
<body>
    <form id="form1" runat="server">
    <div style="padding-top:2%" id="divLinks">
        <table border="0" cellpadding="0" cellspacing="0" style="width:100%;padding-left: 2%;">
            <tr>
                <td style="width:50px">
                    <img id="imgLogo" alt="logo" src="images/sidebar_links_bg.gif" />
                </td>
                <td align="left">
                    <h1 style="font-size:20px;">My Links</h1>
                </td>
            </tr>
        </table>
        <img id="imgheaderhr" src="images/links_header_hr.jpg" alt="link header hr"  style="background-repeat:repeat-x; width: 100%; height: 8px;"/>
        <table border="0" cellpadding="0" cellspacing="0" style="width:100%;padding-left: 2%; padding-top: 15px;">
            <tr>
                <td>
                    <table border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td>
                                <%--main table program here--%>
                                <asp:DataGrid ID="dgLinks" runat="server" AutoGenerateColumns="false" 
                                    Width="600px" BorderColor="Silver" onitemdatabound="dgLinks_ItemDataBound" GridLines="Vertical">
                                    <HeaderStyle BackColor="Silver" />
                                    <Columns>
                                        <asp:BoundColumn  DataField="linkName"  SortExpression="linkName" HeaderText="Name"></asp:BoundColumn>
                                        <asp:BoundColumn DataField ="linkUrl" SortExpression="linkUrl"  HeaderText="Url"></asp:BoundColumn>
                                    </Columns>
                                </asp:DataGrid>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" style="padding-top: 5px">
                                <input type="button" id="btnAddLink" Value="Add" onclick="showLinkOperation('Add');" style="width:50px" />
                                <input type="button" id="btnEditLink" Value="Edit" onclick="showLinkOperation('Edit');" style="width:50px" />
                                <input type="button" id="btnDelete"  Value="Delete" onclick="deleteSelectedLink();" style="width:50px" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <%--some info here--%>
                </td>
            </tr>
        </table>
    </div>
    
        <div id="divLinkPopup" style="position:absolute; display:none">
            <table border="0" 
            style="border:2px solid black;font-size:100%; height: 120px; width: 500px; background-color:#ffffff">
            <tr>
                <td id="tdOperation" align="center" colspan="2" 
                    style="color:White;background-color:steelblue;font-weight:bold;">
                    Add Link</td>
            </tr>
            <tr>
                <td align="right">
                    <asp:Label ID="lblLinkName" runat="server" AssociatedControlID="txtLinkName">Link Name:</asp:Label>
                </td>
                <td style="width:370px">
                    <asp:TextBox ID="txtLinkName" runat="server" Width="350px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right">
                    <asp:Label ID="lblLinkUrl" runat="server" AssociatedControlID="txtLinkUrl">Url:</asp:Label>
                </td>
                <td style="width:370px">
                    <asp:TextBox ID="txtLinkUrl" runat="server" Width="350px"></asp:TextBox>&nbsp;<span style="color:Red">*</span>
                </td>
            </tr>            
            <tr>
                <td align="right">
                    <asp:Label ID="lblLinkDescription" runat="server" AssociatedControlID="txtLinkDescription">Description:</asp:Label>
                </td>
                <td style="width:370px">
                    <asp:TextBox ID="txtLinkDescription" runat="server" Width="350px"></asp:TextBox>
                </td>
            </tr>
             <tr>
                <td align="center" colspan="2" style="color:Red;">
                    <asp:Label ID="lblErrorMessage" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right" colspan="2">
                    <input type="button" id="btnLinkOperation"  value="Add Link" onclick="javascript:PerformLinkOperation();"/>
                    <input type="button" id="btnLinkCancel"  value="Cancel" onclick="javascript:CancelLinkOperation();" />
                </td>
            </tr>
        </table>
        </div>
    </form>
</body>
</html>
